﻿<phone:PhoneApplicationPage 
    x:Class="NoteGardenSL.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="800"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait"
    shell:SystemTray.IsVisible="False">

    <phone:PhoneApplicationPage.Resources>
        <Style TargetType="TextBlock">
            <Setter Property="Foreground" Value="Black" />
        </Style>
        <Style TargetType="CheckBox">
            <Setter Property="Foreground" Value="Black" />
            <Setter Property="BorderBrush" Value="Black" />
        </Style>
        <Style TargetType="RadioButton">
            <Setter Property="Foreground" Value="Black" />
            <Setter Property="BorderBrush" Value="Black" />
        </Style>
    </phone:PhoneApplicationPage.Resources>

    <Grid Background="Transparent">

        <Rectangle Width="240" Height="320" Opacity="0" x:Name="CameraView">
            <Rectangle.Fill>
                <VideoBrush x:Name="viewfinderBrush">
                    <VideoBrush.RelativeTransform>
                        <RotateTransform CenterX="0.5" CenterY="0.5" x:Name="viewfinderBrushTransformation" />
                    </VideoBrush.RelativeTransform>
                </VideoBrush>
            </Rectangle.Fill>
        </Rectangle>

        <Canvas x:Name="MainCanvas"
                Background="Black"
                Width="480"
                Height="800">
        </Canvas>

        <Grid x:Name="DebugConfigOptions">
            <Grid.Background>
                <ImageBrush Stretch="Fill" ImageSource="/SplashScreenImage.jpg"/>
            </Grid.Background>

            <StackPanel Margin="12,17,0,28">
                <TextBlock Text="Note Ga♪den - Debug &amp; Config options" FontWeight="SemiBold" Margin="12" Foreground="White" />

                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                    </Grid.RowDefinitions>
                    <TextBlock Text="Additional Nodes to create:" Margin="12,0" Foreground="White"  />
                    <Slider Minimum="0" Value="20" Maximum="50" x:Name="AdditionalNodesCount" Grid.Row="1" Margin="0,0,12,-36" SmallChange="1" LargeChange="10" />
                    <TextBlock Text="0" Margin="12,0" Grid.Row="2" />
                    <TextBlock Text="{Binding Path=Value, ElementName=AdditionalNodesCount, Converter={StaticResource SliderValueRounder}}" Margin="0" Grid.Row="2" HorizontalAlignment="Center" />
                    <TextBlock Text="50" Margin="12,0,24,0" Grid.Row="2" HorizontalAlignment="Right" />
                </Grid>

                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="*" />
                        <ColumnDefinition Width="*" />
                    </Grid.ColumnDefinitions>
                    <RadioButton Content="UDP comms" x:Name="UdpComms" IsChecked="True" Foreground="White" BorderBrush="White" />
                    <RadioButton Content="Web comms" x:Name="WebComms" Grid.Column="1" Foreground="White" BorderBrush="White" />
                </Grid>

                <!-- The visualizer would be behind the canvas. Make the ccanvas semi-transparent if want to use it.  -->
                <!--<CheckBox x:Name="ShowVisualDebugger" IsChecked="True" Content="Show Visual Debugger" />-->
                <CheckBox x:Name="EnableShakeDetection" IsChecked="True" Content="Enable Shake Detection" Foreground="White" BorderBrush="White" />

                <TextBlock Text="v w.x.y.z" Margin="12,24" x:Name="DisplayedVersionNumber" Foreground="White" />
            </StackPanel>
            <Button Content="Start" VerticalAlignment="Bottom" Margin="12" Click="StartClicked" >
                <Button.BorderBrush>
                    <SolidColorBrush Color="White"/>
                </Button.BorderBrush>
                <Button.Foreground>
                    <SolidColorBrush Color="White"/>
                </Button.Foreground>
            </Button>
        </Grid>
    </Grid>

</phone:PhoneApplicationPage>